let key = 'LoginInfo'
export default [
    {
        url: '/login.json',
        method: 'post',
        statusCode: 200,
        response: (query) => {
            let testinfo = {
                id: 1,
                username: 'admin',
                role: '管理员',
                headImg: ''
            }
            sessionStorage.setItem(key, JSON.stringify(testinfo))
            return {
                code: 200,
                msg: 'OK',
                data: testinfo
            }
        }
    },
    {
        url: '/getCurrentUser.json',
        method: 'get',
        statusCode: 200,
        response: (query) => {
            let info = sessionStorage.getItem('LoginInfo')
            let loginInfo = info ? JSON.parse(info) : {}
            return {
                code: 200,
                msg: 'OK',
                data: loginInfo
            }
        }
    },
    {
        url: '/getMenus.json',
        method: 'get',
        statusCode: 200,
        response: (query) => {
            return {
                code: 200,
                msg: 'OK',
                data: {
                    functionIds: 'F1001,F1002,F1003,F1004,F1005',
                    menus: [
                        {
                            menuname: '组件示例',
                            url: 'demo',
                            icon: 'el-icon-star-on',
                            children: [
                                {
                                    menuname: '区域配置',
                                    url: 'region'
                                },
                                {
                                    menuname: '活动列表',
                                    url: 'activity'
                                }
                            ]
                        },
                        {
                            menuname: '系统设置',
                            url: 'system',
                            icon: 'el-icon-setting',
                            children: [
                                {
                                    menuname: '权限管理',
                                    url: 'authmanagement'
                                },
                                {
                                    menuname: '菜单管理',
                                    url: 'menumanagement'
                                }
                            ]
                        },
                        {
                            menuname: '会员系统',
                            url: 'member',
                            icon: 'el-icon-s-check',
                            children: [
                                {
                                    menuname: '会员管理',
                                    url: 'memberMananer'
                                }
                            ]
                        },
                        {
                            menuname: '订单系统',
                            url: 'order',
                            icon: 'el-icon-s-grid',
                            children: [
                                {
                                    menuname: '订单查询',
                                    url: 'orderquery'
                                }
                            ]
                        },
                        {
                            menuname: '商品系统',
                            url: 'product',
                            icon: 'el-icon-picture-outline',
                            children: [
                                {
                                    menuname: '商品列表',
                                    url: 'productlist'
                                },
                                {
                                    menuname: '品牌管理',
                                    url: 'brandmanage'
                                }
                            ]
                        }
                    ]
                }
            }
        }
    }
]
